<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('channels', function (Blueprint $table) {
            $table->engine  = 'InnoDB';
            $table->comment('渠道');

            $table->id();
            $table->integer('create_time')->comment('创建时间')->unsigned()->default(0);
            $table->integer('channel')->comment('渠道id')->unsigned()->default(0);
            $table->string('channel_name', 32)->comment('渠道名称')->default('');
            $table->tinyInteger('channel_type')->comment('渠道类型 1端 2h5 3微信小游戏')->unsigned()->default(0);
            $table->string('channel_flag', 32)->comment('class类名')->default('');

            $table->index('channel');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('channels');
    }
};
